package org.cnsoft.player.service;

import org.cnsoft.framework.beans.common.RESTResultBean;
import org.cnsoft.framework.beans.user.UserBean;
import org.cnsoft.framework.cache.session.SessionHelper;
import org.cnsoft.framework.weixin.MyWeixinCommonSupport;
import org.cnsoft.player.ISPlayerHomeService;
import org.springframework.stereotype.Service;


/**
 * 用户首页
 * 
 * @author ZmSoft
 * @version 0.1.0 2018/3/1
 * @since 0.1.0 2018/3/1
 */
@Service("ISPlayerHomeService")
// @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public class PLayerHomeService extends MyWeixinCommonSupport implements ISPlayerHomeService {
	//@Resource
	//private P611010PlayerAuthDao daoP611010PlayerAuth;
	
	/**
	 * 获得当前用户登陆信息
	 */
	public RESTResultBean<UserBean> doUserInfo() {
		RESTResultBean<UserBean> result = new RESTResultBean<UserBean>();
		UserBean currentUser = SessionHelper.currentUser();
//		P611010PlayerAuthDBO p611010PlayerAuthDBO = getP611010PlayerAuthDBOById();
		if(true){//p611010PlayerAuthDBO != null){
//			currentUser.setRealName(p611010PlayerAuthDBO.getRealName());
//			currentUser.setIdCard(p611010PlayerAuthDBO.getIdCard());
//			currentUser.setAuthState(p611010PlayerAuthDBO.getStatus());
//			currentUser.setPurseState(p611010PlayerAuthDBO.getWalletStatus());
		}else{
			currentUser.setAuthState("0");//实名认证状态（0失败1成功）
			currentUser.setPurseState("0");//钱包开通状态（0未开通1已开通）
		}
		result.setData(currentUser);
		return result;
	}
	

//	/**
//	 * 获取登陆用户信息
//	 * 
//	 * @return
//	 */
//	private P611010PlayerAuthDBO getP611010PlayerAuthDBOById() {
//
//		UserBean currentUser = SessionHelper.currentUser();
//		String userId = currentUser.getUserId();
//		P611010PlayerAuthDBO userDBO = new P611010PlayerAuthDBO();
//		userDBO.setId(userId);
//		return daoP611010PlayerAuth.doRead(userDBO);
//	}

}
